Bike Trips Sample Application: Using the XMLConnector Component in Flash MX Professional 2004
Table of Contents
- Introduction
- Getting Started: Examining the Bike Trips Application and Its Data
- Configuring the Application to Use the XMLConnector Component
- Binding XML Data to a ComboBox Component
- Creating ComboBox Labels Using XML Data
- Displaying and Updating a Trip Description in a TextArea Component
- Displaying and Updating a Formatted Cost in a TextInput Component
- Displaying and Updating a Graphic in a Loader Component
- Summary and Related Articles and Resources
Getting Started: Examining the Bike Trips Application and Its Data
This application reads bike tour information from an external XML file, and then displays this information for the user. The user may select any tour by name and see the cost, description, and a related graphic. These values update each time the selected trip changes. (The sample is visually simple because the tutorial focuses on component functionality rather than visual design.)
- Download XMLConnector_tutorial.zip and unzip it to a local directory.
-
Notice the files and directory structure:
- Finished application: solution/XMLConnector _done.fla
- Unfinished application: XMLConnector _raw.fla
- Data: data/trips.xml
-
Graphics:
- images/bigsur.jpg
- images/grandcanyon.jpg
- images/greatsmokies.jpg
- images/natchez.jpg
- images/vermont.jpg
- images/napa.jpg
-
Application in staged finishing points for your use and review:
- solution/XMLConnector_step1_done.fla
- solution/XMLConnector_step2_done.fla
- solution/XMLConnector_step3_done.fla
- solution/XMLConnector_step4_done.fla
-
solution/XMLConnector_step5_done.fla
-
Open XMLConnector_done.fla in FlashMX Professional 2004.
- Select Control > Test Movie to test the application.
-
As you test, change the Trip name in the ComboBox component to see the graphics and data update.
Note: In production, your SWF, XML, and JPG files reside in your document root (e.g., /wwwroot) directory. However, you do not need to use a local web server to complete this tutorial.
-
Open the file data/trips.xml and examine the XML data structure.
Note: You may need to change the "Files of Type" pop-up menu in the Open dialog box to "All Files (*.*)" to see this file.
- Close solution/XMLConnector_done.fla but leave data/trips.xml open to re-examine later.